//
//  AppEnvironment.swift
//  GhostWorld
//
//  Created by Kam on 2018/5/27.
//  Copyright © 2018 LKGood. All rights reserved.
//

import Foundation

enum AppEnvironment {
  case Debug
  case TestFlight
  case AppStore
}

struct Config {
  private static let isTestFlight = Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
  
  // This can be used to add debug statements.
  static var isDebug: Bool {
    #if DEBUG
    return true
    #else
    return false
    #endif
  }
  
  static var appEnvironment: AppEnvironment {
    if isDebug {
      return .Debug
    } else if isTestFlight {
      return .TestFlight
    } else {
      return .AppStore
    }
  }
}
